CREATE TABLE [dbo].[Review]
(
[idUspevDocs] [int] NOT NULL,
[Comment] [varchar] (2000) COLLATE Cyrillic_General_CI_AS NOT NULL,
[DateReview] [date] NOT NULL,
[Mark] [smallint] NOT NULL
)
GO
ALTER TABLE [dbo].[Review] ADD CONSTRAINT [ReviewMarkCheck] CHECK (([Mark]>=(2) AND [Mark]<=(5)))
GO
ALTER TABLE [dbo].[Review] ADD CONSTRAINT [PK_Review] PRIMARY KEY CLUSTERED  ([idUspevDocs])
GO
CREATE NONCLUSTERED INDEX [idx_DateReview] ON [dbo].[Review] ([DateReview])
GO
ALTER TABLE [dbo].[Review] ADD CONSTRAINT [ReviewidUspevDocsForeign] FOREIGN KEY ([idUspevDocs]) REFERENCES [dbo].[UspevDocument] ([idUspevDocs]) ON DELETE CASCADE
GO
